package com.free.semantic.web.req;

import com.free.semantic.common.Ls;
import com.free.semantic.common.ParamNode;
import com.free.semantic.common.Range;
import com.free.semantic.common.RangeObj;

import java.util.List;


public class TaskPathRequest {

    private String conceptName;

    private List<ParamNode> from;

    private String destObject;

    private Range destRange;

    public Range getDestRange() {
        return destRange;
    }

    public void setDestRange(Range destRange) {
        this.destRange = destRange;
    }

    public RangeObj getDestRangeObj() {
        if (destRange == null) {
            return RangeObj.more(destObject);
        } else {
            if (Ls.of(Range.ONE, Range.LESS_ONE, Range.MULTIPLE, Range.MORE_ONE).contains(destRange)) {
                RangeObj rangeObj = new RangeObj();
                rangeObj.setRange(destRange);
                rangeObj.setObjectName(destObject);
                return rangeObj;
            } else {
                throw new RuntimeException(String.format("暂时不支持%s 数据范围", destRange));
            }
        }
    }

    public String getConceptName() {
        return conceptName;
    }

    public void setConceptName(String conceptName) {
        this.conceptName = conceptName;
    }

    public List<ParamNode> getFrom() {
        return from;
    }

    public void setFrom(List<ParamNode> from) {
        this.from = from;
    }

    public String getDestObject() {
        return destObject;
    }

    public void setDestObject(String destObject) {
        this.destObject = destObject;
    }

}
